package org.corolla.cloth.compute;

import java.util.Set;

import org.corolla.cloth.constdata.ParamConst;
import org.corolla.cloth.entity.Accessory;

public class ComputePriceBySize {
	
	/**
	 * 根据一个衣服尺寸，获取单价
	 * P单价=(P面+P辅+P加)*(1+β)*（1+γ)*F(μ)*(1+R)
	 * β=0.1
	 * γ=0.2
	 * F（μ）=1
	 * R=0.1
	 * @param clothSizeKey
	 * @param accessorySet
	 * @param clothMount和加工费有关系
	 * @return
	 */
	public static double getPriceBySize(String clothSizeKey,Set<Accessory> accessorySet,int clothMount,double liningPrice){
		double unitPriceBySize= 0.0d;
		
		// 获取面料面积
		double material = ComputeMaterial.getMaterial(clothSizeKey);
		
		// 获取面料价格
		double materialPrice = liningPrice* material;
		
		
		// 获取辅料
		double accessoryPrice = ComputeAccessory.getAccessory(accessorySet);
		
		// 获取加工费
		double processingFees = ComputeProcessFees.getProcessFess(clothMount);
		
		unitPriceBySize = (materialPrice + accessoryPrice + processingFees)*(1+ParamConst.BETA)*
				(1+ParamConst.GAMMA)*ParamConst.FU*(1+ParamConst.R);
		
		return unitPriceBySize;
	}

}
